!function(n,e){var define;"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["teads-fellow"]=e():n["teads-fellow"]=e()}(this,(()=>(()=>{"use strict";var n,e,t={},o={};function i(n){var e=o[n];if(void 0!==e)return e.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,i),a.exports}i.m=t,i.d=(n,e)=>{for(var t in e)i.o(e,t)&&!i.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},i.f={},i.e=n=>Promise.all(Object.keys(i.f).reduce(((e,t)=>(i.f[t](n,e),e)),[])),i.u=n=>n+".js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),i.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),n={},e="performance-tracker:",i.l=(t,o,a,r)=>{if(n[t])n[t].push(o);else{var s,c;if(void 0!==a)for(var d=document.getElementsByTagName("script"),l=0;l{s.onerror=s.onload=null,clearTimeout(v);var i=n[t];if(delete n[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((n=>n(o))),e)return e(o)},v=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},i.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},(()=>{var n;i.g.importScripts&&(n=i.g.location+"");var e=i.g.document;if(!n&&e&&(e.currentScript&&(n=e.currentScript.src),!n)){var t=e.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!n||!/^http(s?):/.test(n));)n=t[o--].src}if(!n)throw new Error("Automatic publicPath is not supported in this browser");n=n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=n})(),(()=>{var n={284:0};i.f.j=(e,t)=>{var o=i.o(n,e)?n[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,i)=>o=n[e]=[t,i]));t.push(o[2]=a);var r=i.p+i.u(e),s=new Error;i.l(r,(t=>{if(i.o(n,e)&&(0!==(o=n[e])&&(n[e]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+a+": "+r+")",s.name="ChunkLoadError",s.type=a,s.request=r,o[1](s)}}),"chunk-"+e,e)}};var e=(e,t)=>{var o,a,[r,s,c]=t,d=0;if(r.some((e=>0!==n[e]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);c&&c(i)}for(e&&e(t);d{try{return!!localStorage.getItem("teads_debug")}catch{return!1}})();function s(n,e){r&&(void 0!==e?(console.groupCollapsed("[Teads Debug] ".concat(n)),console.log(e),console.groupEnd()):console.log("[Teads Debug] ".concat(n)))}const c="8.14.1_bd426f7",d="https://t.teads.tv/track",l="https://p.teads.tv/obtr",u="https://p.teads.tv/obwave",p="".concat(l,"/unifiedPixel"),v="https://cm.teads.tv/v2/advertiser",f="tag",w="outbrain",_="dicbo",g="dicbo_id",h="ob_click_id",m="dicbo_fetch",y="teads",b=100,C=132,I=164,E="teads",A=[1,3,4];let O=function(n){return n.Default="all",n.EuZone1="euZone1",n.EuZone2="euZone2",n.UsCanada="usCanada",n}({});const k={tcf:100,gpp:90,cb:70,ot:70,di:70,gtm:60,uc:60,shopify:50,g111:40,ccpa:30,timeout:0,gpc:0,gpp_opt_out:0,canada_opt_out:0};function S(n){var e;return n&&null!==(e=k[n])&&void 0!==e?e:0}const P={listeners:{},on(n,e){return Object.prototype.hasOwnProperty.call(this.listeners,n)||(this.listeners[n]=[]),this.listeners[n].push(e),()=>{this.listeners[n]=this.listeners[n].filter((n=>n!=e))}},once(n,e){const t=this.on(n,(function(){t(),e(...arguments)}));return t},dispatch(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;on.call(null,...t)))}},T="js-web",N="js-gtm";let D=!1;function L(){return window.advertiser_domain}function U(){return window.teads_buyer_pixel_id}function R(){return!0===window.teads_post_message_event_to_window}function x(n){window.teads_iab_tcf_consent_data=n}function M(){return window.teads_iab_tcf_consent_data}function j(n){window.teads_vendor_disclosed=n}function F(n){window.teads_iab_gpp_consent_data=n}function G(){return window.teads_iab_gpp_consent_data}function B(n){window.teads_gpp_parsed_sections=n}function V(){return window.teads_gpp_parsed_sections}function z(n){window.teads_usp_consent_data=n}function X(){return window.teads_usp_consent_data}function J(n){window.teads_gtm_consent_data=n}function W(){return window.teads_gtm_consent_data}function Z(n){window.teads_didomi_consent_data=n}function K(){return window.teads_didomi_consent_data}function H(n){window.teads_cookiebot_consent_data=n}function q(){return window.teads_cookiebot_consent_data}function $(n){window.teads_onetrust_consent_data=n}function Y(){return window.teads_onetrust_consent_data}function Q(n){window.teads_in_iframe_consent_data=n}function nn(n){window.teads_user_centric_consent_data=n}function en(n){window.teads_shopify_consent_data=n}function tn(n){window.teads_tracking_allowed=n}function on(){return!0===window.teads_tracking_allowed}function an(n){let{hasConsent:e,type:t}=n;const o=window.teads_consent;if(("gpc"===t||"gpp_opt_out"===t||"canada_opt_out"===t)&&!e&&On())return void(window.teads_consent={has_consent:!1,consent_handler_type:t});const i=null==o?void 0:o.consent_handler_type,a=On()&&("gpc"===i||"gpp_opt_out"===i||"canada_opt_out"===i);if(null!=o&&o.has_consent||!a)if(null!=o&&o.has_consent){const n=S(o.consent_handler_type),i=S(t);t&&i>n&&("timeout"===o.consent_handler_type?window.teads_consent={has_consent:e,consent_handler_type:t}:e&&(window.teads_consent={...o,consent_handler_type:t}))}else window.teads_consent={has_consent:e,consent_handler_type:t},e&&(window.teads_tracking_allowed=!0,P.dispatch("consentGranted"));else s("Consent update ignored — hard block ".concat(i," is active"))}function rn(){var n;return void 0===(null===(n=window.teads_consent)||void 0===n?void 0:n.has_consent)?{hasConsent:!1}:{hasConsent:window.teads_consent.has_consent,type:window.teads_consent.consent_handler_type}}function sn(){const n=rn().type;return n&&"timeout"!==n?n:null}function cn(){return!!sn()}function dn(){var n;return null===(n=window.teads_consent)||void 0===n?void 0:n.has_consent}function ln(){var n;return void 0===(null===(n=window.outbrain_consent)||void 0===n?void 0:n.has_consent)?{hasConsent:!1}:{hasConsent:window.outbrain_consent.has_consent,type:window.outbrain_consent.consent_handler_type}}function un(){return ln().hasConsent}function pn(n){window.teads_auction_id=n}function vn(){return window.teads_auction_id}function fn(n){const e=window.teads_auction_id_forwarded_by||{};e[n]=!0,window.teads_auction_id_forwarded_by=e}function wn(){var n;return null!==(n=window.teads_outbrainAdvertiserIds)&&void 0!==n&&n.length?window.teads_outbrainAdvertiserIds:window.teads_outbrainAdvertiserId?[window.teads_outbrainAdvertiserId]:[]}function _n(){var n;return null!==(n=window.teads_outbrainAdvertiserIds)&&void 0!==n&&n.length?window.teads_outbrainAdvertiserIds.join(","):window.teads_outbrainAdvertiserId?window.teads_outbrainAdvertiserId:""}function gn(n){window.teads_session_id=n}function hn(){return window.teads_session_id}function mn(){return window.teads_viewer_id}function yn(){return!0!==window.teads_disable_first_party_cookie&&window.first_party_cookie_allowed}function bn(n){window.teads_tracking_events_sent||(window.teads_tracking_events_sent=[]),window.teads_tracking_events_sent.push(n)}const Cn=n=>{D=n};function In(){if(void 0!==window.teads&&void 0!==window.teads.advertiserId){if("number"==typeof window.teads.advertiserId)return window.teads.advertiserId}else{if(void 0===window.teads_cv||void 0===window.teads_cv.advertiserId)return window.teads_adv_id;if("number"==typeof window.teads_cv.advertiserId)return window.teads_cv.advertiserId}}function En(){return window.teads_env&&[T,N].includes(window.teads_env)?window.teads_env:T}function An(){return window.teads_zone===O.Default}function On(){return window.teads_zone===O.UsCanada}function kn(){return window.teads_zone===O.EuZone1||window.teads_zone===O.EuZone2}function Sn(){return"undefined"!=typeof navigator&&!0===navigator.globalPrivacyControl&&(kn()||On())}const Pn="https://l.teads.tv/performance/http-source",Tn={INTERNAL:"internal",BAD_INTEGRATION:"bad_integration"};function Nn(n){return"[object Function]"===toString.call(n)}function Dn(n){let e="";const t=function(n){let e=n,t=!1;try{for(let n=0;e.parent.document!==e.document||n<50;n+=1){if(!e.parent.document){t=!0;break}e=e.parent}}catch(n){t=!0}return{topFrame:e,err:t}}(n),{topFrame:o}=t;if(t.err)try{e=o.top.location.href}catch(n){e=o.location.href}else e=o.location.href;return e}function Ln(n,e,t){try{const o={errorMessage:n,topUrl:Dn(window),userAgent:void 0!==window.navigator&&void 0!==window.navigator.userAgent?window.navigator.userAgent:"",exception:e||"",version:c,type:t||Tn.BAD_INTEGRATION};n=JSON.stringify(o)}catch(n){}document.createElement("img").src="".concat(Pn,"?").concat(encodeURIComponent(n))}function Un(n,e,t,o){try{(new Image).src="".concat(l,"/log?clickId=").concat(o||"","&eventName=").concat(t||"")+"&msg=".concat(encodeURIComponent('{"error":"LOAD", "teadsApiVersion": '.concat(c,', "marketerID": ').concat(_n(),', \n "referrer": ').concat(document.URL,', "pRef": ').concat(document.referrer,', "extra": {"name":"').concat(n.name,'","line":"').concat(n.lineNumber||n.line,'","script":"').concat(n.fileName||n.sourceURL||n.script,'","stack":"').concat(n.stackTrace||n.stack,'","errorMessage":"').concat(n.message,'", "message":"').concat(e,'"}}')))}catch(n){}}function Rn(n){const e=["account","password","pass","secret","secretkey","username","user","login","ordernumber","orderid","email","mail","user.email","user.password","user.name","user.mail","user.lastname","user.firstname","user.phone","user.phonenumber","lastname","firstname","name","address","phonenumber","phone","client_secret","guid"];if(""!==n){const t=n.split("?").length>1?n.split("?")[1]:void 0;if(void 0!==t){let o="".concat(n.split("?")[0],"?");const i=t.split("&");for(let n=0;n=0?"XXXXXXXX":t[1])}n=o}}return n}function xn(n){try{const e=new RegExp("(?:\\?|&|%3F|%26)auctid(?:=|%3D)([0-9a-zA-Z-_]*)").exec(n);if(e&&e.length>=2)return e[1]}catch(n){Ln("Error when extracting Auction ID from url",null==n?void 0:n.message,Tn.INTERNAL)}}function Mn(n,e){var t,o,i,a,r,s,d,l,u,p,v,w;const _=In(),g=U(),h=En(),m=function(n){const e=[];return Object.keys(n).forEach((t=>{e.push("".concat(t,"=").concat(encodeURIComponent(n[t])))})),e.join("&")}(e),y=Dn(window),b=function(n){let e=vn();if(!e){let t=n;n||(t=Dn(window)),e=xn(t),e&&(pn(e),fn("url"))}return e}(y),C=function(){const n=window.teads_auction_id_forwarded_by;return n?Object.keys(n).join(","):void 0}(),I=hn(),E=mn(),A=M(),O=G(),k=X(),S=window.teads_gdpr_advertiser,P=window.teads_ccpa_advertiser,T=Rn(y),N=rn(),D=window.teads_vendor_disclosed;let L="?action=".concat(n,"&env=").concat(encodeURIComponent(h),"&tag_version=").concat(encodeURIComponent(c),"&provider=").concat(f);if(m.length>0&&(L="".concat(L,"&").concat(m)),void 0!==g?L="".concat(L,"&buyer_pixel_id=").concat(encodeURIComponent(g)):void 0!==_&&(L="".concat(L,"&advertiser_id=").concat(encodeURIComponent(_))),L="".concat(L,"&referer=").concat(encodeURIComponent(T)),("pageView"===n||"conversion"===n)&&document.referrer){const n=Gn(document.referrer),e=Gn(y);""!==n&&""!==e&&n!==e&&(L="".concat(L,"&prev_referrer=").concat(encodeURIComponent(n)))}void 0!==b&&(L="".concat(L,"&auctid=").concat(b)),void 0!==C&&(L="".concat(L,"&cohort_id=").concat(C)),void 0!==I&&(L="".concat(L,"&user_session_id=").concat(I)),void 0!==E&&(L="".concat(L,"&firstPartyCookieTeadsId=").concat(E)),void 0!==(null==A||null===(t=A.data)||void 0===t?void 0:t.tcString)&&(L="".concat(L,"&gdpr_consent=").concat(A.data.tcString));const R=null!==(o=null==A||null===(i=A.data)||void 0===i?void 0:i.gdprApplies)&&void 0!==o?o:null==S?void 0:S.apply;void 0!==R&&(L="".concat(L,R?"&gdpr_status=12":"&gdpr_status=0"),L="".concat(L,"&gdpr_apply=").concat(R)),void 0!==(null==S?void 0:S.teadsConsent)&&(L="".concat(L,">c=").concat(S.teadsConsent));const x=null!==(a=null==A||null===(r=A.data)||void 0===r?void 0:r.isServiceSpecific)&&void 0!==a?a:null==S?void 0:S.isServiceSpecific;void 0!==x&&(L="".concat(L,"&gdpr_is_service_specific=").concat(x));const j=null!==(s=null==A||null===(d=A.data)||void 0===d?void 0:d.cmpId)&&void 0!==s?s:null==S?void 0:S.cmpId;void 0!==j&&(L="".concat(L,"&gdpr_cmp_id=").concat(j)),void 0!==(null==S?void 0:S.apiVersion)&&(L="".concat(L,"&gdpr_api_version=").concat(S.apiVersion));const F=null==A||null===(l=A.data)||void 0===l||null===(l=l.purpose)||void 0===l?void 0:l.consents;return void 0!==(null==F?void 0:F[1])&&(L="".concat(L,"&gac=").concat(F[1]?1:0)),void 0!==(null==F?void 0:F[4])&&(L="".concat(L,"&gap=").concat(F[4]?1:0)),void 0!==(null==k||null===(u=k.data)||void 0===u?void 0:u.usPrivacy)&&(L="".concat(L,"&ccpa_consent=").concat(k.data.usPrivacy)),P&&(void 0!==P.apply&&(L="".concat(L,"&ca=").concat(P.apply)),void 0!==P.teadsConsent&&(L="".concat(L,"&ctc=").concat(P.teadsConsent))),void 0!==(null==O||null===(p=O.data)||void 0===p?void 0:p.gppString)&&(L="".concat(L,"&gpp_consent_string=").concat(encodeURIComponent(O.data.gppString))),void 0!==(null==O||null===(v=O.data)||void 0===v?void 0:v.applicableSections)&&(L="".concat(L,"&gpp_applicable_section_ids=").concat(encodeURIComponent(O.data.applicableSections.join(",")))),void 0!==(null==O||null===(w=O.data)||void 0===w?void 0:w.resolvedConsentStatus)&&(L="".concat(L,"&gpp_resolved_consent_status=").concat(O.data.resolvedConsentStatus)),N&&void 0!==N.type&&(L="".concat(L,"&hasConsent=").concat(N.hasConsent),L="".concat(L,"&cht=").concat(N.type)),null!=D&&"no_segment"!==D&&(L="".concat(L,"&teads_vendor_disclosed=").concat("disclosed"===D)),L}function jn(n,e){const t=document.createElement("img");t.width=0,t.height=0,t.alt="",t.style.position="absolute",t.onerror=()=>{null!=e&&e.onFallback?Promise.resolve(e.onFallback(n)).catch((e=>{s("Fallback threw unexpectedly",{url:n,error:e instanceof Error?e.message:e})})):Ln("Pixel delivery failed via DOM img tag",void 0,Tn.INTERNAL)},null!=e&&e.onLoad&&(t.onload=e.onLoad),t.src=n,Fn(t)}const Fn=n=>(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]||document.getElementsByTagName("script")[0].parentNode).insertBefore(n,null);function Gn(n){try{return new URL(n).hostname}catch(n){return""}}const Bn={auctionId:{key:"tfpai",maxAge:2592e3,isJson:!0},sessionId:{key:"tfpsi",maxAge:1800,isJson:!1},viewerId:{key:"tfpvi",maxAge:7776e3,isJson:!1}};function Vn(n){try{Kn(n,"",L(),0,"/","none",!0)}catch(e){Ln('Error while deleting cookie on domain with key "'.concat(n,'"'),null==e?void 0:e.message,Tn.INTERNAL)}}function zn(n,e,t){try{Kn(n,e,L(),t,"/","none",!0)}catch(e){Ln('Error while setting cookie on domain with key "'.concat(n,'"'),null==e?void 0:e.message,Tn.INTERNAL)}}function Xn(n){const e="".concat(n,"="),t=document.cookie.split(";");for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return{type:n,id:null===(e=window)||void 0===e?void 0:e.name,ts:Date.now(),host:null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.host,...o}}function Yn(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"*";try{var o,i;const a=(null===(o=window)||void 0===o||null===(o=o.opener)||void 0===o?void 0:o.top)||(null===(i=window)||void 0===i?void 0:i.opener);Nn(a.postMessage)&&a.postMessage($n(n,e),t)}catch(n){}}function Qn(n){var e;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/";if(Nn(null===(e=window)||void 0===e?void 0:e.postMessage))try{window.postMessage($n(n,t),o)}catch(n){}}function ne(n){var e,t,o,i,a;null!==(e=window)&&void 0!==e&&e.opener&&((null==n||null===(o=n.data)||void 0===o?void 0:o.type)===qn.PIXEL_DEBUG&&(window.teads_post_message_event_to_opener=true),(null==n||null===(i=n.data)||void 0===i?void 0:i.type)===qn.SDK_PARAMETERS&&null!=n&&null!==(a=n.data)&&void 0!==a&&a.teadsClickId&&(pn(n.data.teadsClickId),fn("postMessage"),Wn())),(null==n||null===(t=n.data)||void 0===t?void 0:t.type)===qn.ASK_PIXEL_INFO&&(Qn(qn.PIXEL_INFO,{buyerPixelId:U(),advertiserId:In(),trackingAllowed:on(),firstPartyCookieAllowed:yn(),advertiserDomain:L(),auctionId:vn(),env:En(),iabData:M(),uspData:X(),gppIabData:G(),referer:Rn(Dn(window)),trackingEventsSent:window.teads_tracking_events_sent||[],request:n.data,isCompatibleCMPDetected:cn(),consentHandlerType:sn(),hasConsent:rn().hasConsent}),window.teads_post_message_event_to_window=!0)}let ee=!1;const te={browsingTopics:!0,cache:"no-cache",credentials:"include",keepalive:!0};function oe(n){!0===window.teads_post_message_event_to_opener&&Yn(qn.PIXEL_EVENT,{trackingUrl:n}),R()&&Qn(qn.PIXEL_EVENT,{trackingUrl:n})}function ie(n){if(ee)re(n,!0);else{try{jn(n)}catch(e){return ee=!0,Ln("DOM pixel insertion failed, switching to beacon",null==e?void 0:e.message,Tn.BAD_INTEGRATION),void re(n,!0)}oe(n)}}async function ae(n,e,t){try{await fetch(n,{...te,...t}).then((n=>{var e;return null==n||null===(e=n.arrayBuffer)||void 0===e?void 0:e.call(n).catch((()=>{}))})).then((()=>{oe(n)}))}catch(t){!1===e?(s("Fetch pixel delivery failed (no fallback)",{trackingUrl:n,error:null==t?void 0:t.message}),Ln("Unable to fire a log using fetch API",null==t?void 0:t.message,Tn.BAD_INTEGRATION)):ee?Ln("Unable to fire a log using fetch API in sandbox environment",null==t?void 0:t.message,Tn.BAD_INTEGRATION):(s("Fetch failed, falling back to DOM img",{trackingUrl:n,error:null==t?void 0:t.message}),function(n){jn(n,{onFallback:()=>{s("DOM img fallback failed (end of fallback chain)",{url:n}),Ln("Pixel delivery failed via DOM img tag",void 0,Tn.INTERNAL)},onLoad:()=>{oe(n)}})}(n))}}async function re(n,e){const t=function(n){try{const e=navigator.sendBeacon&&navigator.sendBeacon.bind(navigator);return e&&e(n)?null:new Error("Beacon not sent")}catch(n){return n instanceof Error?n:new Error("sendBeacon threw")}}(n);t?!1===e?(s("Beacon pixel delivery failed (no fallback)",{trackingUrl:n,error:t.message}),Ln("Unable to fire a log using beacon API",t.message,Tn.BAD_INTEGRATION)):(s("Beacon failed, falling back to fetch",{trackingUrl:n,error:t.message}),await ae(n,!0)):oe(n)}function se(n,e,t){let o,i,a=t;for(;!o;){try{if("function"==typeof a[n]){i=a[n],o=a;break}}catch(n){}try{if(a.frames[e]){o=a;break}}catch(n){}if(a===t.top)break;a=a.parent}return{cmpFrame:o,cmpFunction:i}}let ce=function(n){return n.Ping="ping",n.AddEventListener="addEventListener",n.RemoveEventListener="removeEventListener",n}({}),de=function(n){return n.Ready="ready",n.NotReady="Not ready",n}({});function le(n,e,t){return new Promise(((o,i)=>{if(void 0!==n)switch(e){case ce.Ping:n(e,((n,e)=>{e?o(n):i(new Error("Ping command failed"))}));break;case ce.AddEventListener:n(e,((n,e)=>{e?o(n):i(new Error("AddEventListener command failed"))}));break;case ce.RemoveEventListener:"number"==typeof t&&n(e,t,(()=>{}));break;default:i(new Error("Invalid GPP command"))}}))}function ue(n,e){return n?n.has(e)?"disclosed":"not_disclosed":"no_segment"}function pe(n,e){return"not_disclosed"!==ue(n.vendorsDisclosed.size>0?new Set(n.vendorsDisclosed.values()):void 0,e)&&(n.vendorConsents.has(e)?n.purposeConsents.has(1):void 0)}function ve(n){if(null==n||!n.consents)return!0;for(const e of A)if(!1===n.consents[e])return!1;return!0}function fe(n){if(n.type&&!_e(n.type))return void s("Consent ignored — ".concat(n.type," not supported in zone ").concat(window.teads_zone));const e=n.vendor?" (".concat(n.vendor,")"):"";s("Consent: ".concat(n.type," → ").concat(n.hasConsent?"granted":"denied").concat(e)),function(n){"Teads"===n.vendor?an(n):("Outbrain"===n.vendor||an(n),function(n){let{hasConsent:e,type:t}=n;const o=window.outbrain_consent;null!=o&&o.has_consent?e&&t&&S(t)>S(o.consent_handler_type)&&(window.outbrain_consent={...o,consent_handler_type:t}):window.outbrain_consent={has_consent:e,consent_handler_type:t}}(n))}(n),"Teads"!==n.vendor&&n.hasConsent&&P.dispatch("hasObConsent")}const we=["gpp","ccpa"];function _e(n){switch(window.teads_zone){case O.EuZone1:case O.EuZone2:return!["ccpa"].includes(n);case O.UsCanada:return["ccpa","gpp","tcf","shopify","timeout","gpc","gpp_opt_out","canada_opt_out"].includes(n);default:return["ccpa","gpp","tcf","shopify","timeout","gpc"].includes(n)}}const ge=n=>n===de.Ready,he=n=>null!=n,me="us",ye=["SaleOptOut","SharingOptOut","TargetedAdvertisingOptOut","MspaServiceProviderMode"];function be(n){return!!n&&Object.entries(n).some((n=>{let[e,t]=n;if(!e.startsWith(me)||"object"!=typeof t||null===t)return!1;const o=t;return ye.some((n=>1===o[n]))}))}function Ce(n){if(!n)return!1;const e=n.tcfcav1;if(null==e)return!1;const t=Array.isArray(e)?e[0]:e;if("object"!=typeof t||null===t)return!1;const o=t,i=Array.isArray(o.VendorExpressConsent)?o.VendorExpressConsent:null,a=Array.isArray(o.VendorImpliedConsent)?o.VendorImpliedConsent:null;return!(null===i&&null===a||(null!=i?i:[]).includes(C)||(null!=a?a:[]).includes(C))}class Ie{constructor(){var n,e,t;n=this,t=!1,(e=function(n){var e=function(n,e){if("object"!=typeof n||!n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var o=t.call(n,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"==typeof e?e:e+""}(e="isGppAvailable"))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t;const{cmpFunction:o,cmpFrame:i}=se("__gpp","__gppLocator",window);Nn(o)?this.gpp=o:i&&(this.gpp=Ie.buildCmpFunctionWithPostMessage(i)),this.isGppAvailable="function"==typeof this.gpp}static buildCmpFunctionWithPostMessage(n){const e={},t="__gpp",o="".concat(t,"Call");return n.addEventListener("message",(function(n){const o="".concat(t,"Return"),i="string"==typeof n.data&&"".concat(n.data).includes(o)?JSON.parse(n.data):n.data;if(i[o]&&i[o].callId){const n=i[o];"function"==typeof e[n.callId]&&e[n.callId](n.returnValue,n.success)}}),!1),(t,i,a)=>{const r="".concat(Math.random()),s={[o]:{command:t,version:"1.1",callId:r}};t===ce.RemoveEventListener?e[r]=a:e[r]=i,n.postMessage(s,"*")}}async retrieveConsent(n,e){if(this.isGppAvailable)try{let t;const o=await Promise.race([le(this.gpp,ce.Ping),new Promise(((n,o)=>{t=setTimeout((()=>{e("GPP ping timed out"),o("Unable to ping the GPP CMP")}),b)}))]);if(clearTimeout(t),ge(o.signalStatus)&&(B(o.parsedSections),he(o.gppString)))return void await this.parseGppString(o,n,e);const i=await le(this.gpp,ce.AddEventListener);le(this.gpp,ce.RemoveEventListener,i.listenerId);const{pingData:a}=i;if(!ge(a.signalStatus))return void e("CMP is expecting changes, consent data is not available yet");if(B(a.parsedSections),!he(a.gppString))return e("Expected gppString to be a string but got null or undefined"),void fe({hasConsent:!1,type:"gpp"});const r=i.pingData;await this.parseGppString(r,n,e)}catch(n){e("Error during GPP command call: ".concat(n))}}async parseGppString(n,e,t){var o;if(!this.iabLib)try{this.iabLib=await i.e(854).then(i.bind(i,854))}catch(n){return fe({hasConsent:An(),type:"gpp"}),void t("Failed to load iab library: ".concat(n))}if(kn()&&(null===(o=n.applicableSections)||void 0===o||!o.includes(2)))return fe({hasConsent:!1,type:"gpp"}),void e({applicableSections:n.applicableSections,gppString:n.gppString,resolvedConsentStatus:"NOT_ALLOWED"});const a=this.decodeGppString(n.gppString);j(a?ue(a.vendorsDisclosed.size>0?new Set(a.vendorsDisclosed.values()):void 0,C):null);const r=a?pe(a,C):void 0,s=n=>{var e;return null!==(e=a&&pe(a,n))&&void 0!==e?e:An()};fe({hasConsent:s(C),type:"gpp",vendor:"Teads"}),fe({hasConsent:s(I),type:"gpp",vendor:"Outbrain"});const c=!0===r?"ALLOWED":!1===r?"NOT_ALLOWED":"UNKNOWN";e({applicableSections:n.applicableSections,gppString:n.gppString,resolvedConsentStatus:c})}decodeGppString(n){try{return this.iabLib.TCString.decode(n)}catch(e){if(n.startsWith("D"))try{return this.iabLib.TCString.decode(n.substring(n.indexOf("~")+1))}catch(n){}return}}retrieveConsentWithoutHolding(n,e){let t=!1,o=!1;this.retrieveConsent((e=>{o||(t=!0,n(e))}),(n=>{t||(o=!0,e(n))}))}}function Ee(n,e){const t=new Ie;return t.isGppAvailable&&t.retrieveConsentWithoutHolding(n,e),t.isGppAvailable}function Ae(n,e){let t=!1;function o(t,o){o?!1!==t.gdprApplies&&"tcloaded"!==t.eventStatus&&"useractioncomplete"!==t.eventStatus||(function(n){var e,t,o;const i=null===(e=n.vendor)||void 0===e?void 0:e.disclosedVendors,a=i?new Set(Object.keys(i).map(Number).filter((n=>i[n]))):void 0,r=ue(a,C);j(r),"not_disclosed"===r||null!==(t=n.vendor)&&void 0!==t&&t.consents&&!n.vendor.consents[C]||!ve(n.purpose)?fe({hasConsent:!1,type:"tcf",vendor:"Teads"}):fe({hasConsent:!0,type:"tcf",vendor:"Teads"}),"not_disclosed"===ue(a,I)||null!==(o=n.vendor)&&void 0!==o&&o.consents&&!n.vendor.consents[I]||!ve(n.purpose)?fe({hasConsent:!1,type:"tcf",vendor:"Outbrain"}):fe({hasConsent:!0,type:"tcf",vendor:"Outbrain"})}(t),n(t)):e("CMP unable to register callback function. Please check CMP setup.")}const i="__tcfapi",a={};function r(n){const e="".concat(i,"Return"),t="string"==typeof n.data&&"".concat(n.data).includes(e)?JSON.parse(n.data):n.data;if(t[e]&&t[e].callId){const n=t[e];void 0!==a[n.callId]&&a[n.callId](n.returnValue,n.success)}}function s(n,e,o){const s="".concat(i,"Call");window[i]=(n,t,o,i)=>{const r="".concat(Math.random()),c={[s]:{command:n,version:t,parameter:i,callId:r}};a[r]=o,e.postMessage(c,"*")},t||window.addEventListener("message",r,!1),window[i](n,2,o)}const{cmpFrame:c,cmpFunction:d}=se("__tcfapi","__tcfapiLocator",window);return!!c&&(new Promise(((n,e)=>{Nn(d)?d("ping",2,(()=>n())):s("ping",c,(()=>n())),setTimeout((()=>e()),b)})).catch((()=>e("Unable to ping the CMP"))),t||(t=!0,Nn(d)?d("addEventListener",2,o):s("addEventListener",c,o)),!0)}function Oe(n,e){const t={};function o(n){const e=n&&n.data&&n.data.__uspapiReturn;e&&e.callId&&void 0!==t[e.callId]&&(t[e.callId](e.returnValue,e.success),delete t[e.callId])}let i=!1;function a(n,e,a){i||(window.addEventListener("message",o,!1),i=!0),function(n,o,i){const a="".concat(Math.random()),r={__uspapiCall:{command:n,version:1,callId:a}};t[a]=i,e.postMessage(r,"*")}(n,0,a)}const{cmpFrame:r,cmpFunction:s}=se("__uspapi","__uspapiLocator",window);if(!r)return!1;new Promise(((n,e)=>{Nn(s)?s("getUSPData",1,(()=>n())):a("getUSPData",r,(()=>n())),setTimeout((()=>e()),b)})).catch((()=>e("Unable to ping the USP")));const c=function(){const t={};return{consentDataCallback:(o,i)=>{i&&o.uspString&&(t.usPrivacy=o.uspString),function(n,e){var t,o;null!=n&&n.uspString?e&&"Y"!==(null==(t=n.uspString)||null===(o=t[2])||void 0===o?void 0:o.toUpperCase())?fe({hasConsent:!0,type:"ccpa"}):fe({hasConsent:!1,type:"ccpa"}):fe({hasConsent:An(),type:An()?"ccpa":void 0})}(o,i),t.usPrivacy?n(t):e("Unable to get USP consent string.")}}}();return Nn(s)?s("getUSPData",1,c.consentDataCallback):a("getUSPData",r,c.consentDataCallback),!0}function ke(n,e){const t=["ad_storage","ad_user_data"];let o=!1;function i(){return t.every((n=>{var e;return!0===(null===(e=window.google_tag_data)||void 0===e||null===(e=e.ics)||void 0===e||null===(e=e.entries[n])||void 0===e?void 0:e.update)}))}if(window.google_tag_data){var a;const s=window.google_tag_data;return null!=s&&null!==(a=s.ics)&&void 0!==a&&a.entries?(fe({hasConsent:i(),type:"gtm"}),o||i()||null===(r=window.google_tag_data)||void 0===r||null===(r=r.ics)||void 0===r||!r.addListener||(o=!0,window.google_tag_data.ics.addListener(t,(function(){fe({hasConsent:i(),type:"gtm"}),n({hasConsent:i()})}))),n({hasConsent:i()}),!0):(e("Unable to get consent data from GTM"),!1)}var r;return!1}function Se(n){if(window.didomiState){const e=window.didomiState;if(!e)return!1;e.didomiPurposesConsent||(fe({hasConsent:!1,type:"di"}),n({hasConsent:!1}));const t=e.didomiPurposesConsent.indexOf("cookies")>-1&&e.didomiPurposesConsent.indexOf("measure_ad_performance")>-1;return fe({hasConsent:t,type:"di"}),n({hasConsent:t}),!0}return!1}function Pe(n){let e=!1;if(window.Cookiebot){const i=window.Cookiebot;if(i){var t,o;const a=null!==(t=null===(o=i.consent)||void 0===o?void 0:o.marketing)&&void 0!==t?t:An();return fe({hasConsent:a,type:"cb"}),e||(e=!0,window.addEventListener("CookiebotOnAccept",(()=>{fe({hasConsent:!0,type:"cb"})}),!1)),n({hasConsent:a}),!0}return!1}return!1}function Te(n){let e=!1;function t(){var n,e;const t=null===(n=window.OnetrustActiveGroups)||void 0===n?void 0:n.toUpperCase();return null!==(e=(null==t?void 0:t.indexOf("C0004"))>-1)&&void 0!==e?e:An()}var o,i;return!!window.OnetrustActiveGroups&&!(!(null===(o=window.OnetrustActiveGroups)||void 0===o?void 0:o.toUpperCase())||(t()?(fe({hasConsent:!0,type:"ot"}),n({hasConsent:!0}),0):"OneTrust"in window?(!e&&null!==(i=window.OneTrust)&&void 0!==i&&i.OnConsentChanged&&(e=!0,window.OneTrust.OnConsentChanged((()=>{fe({hasConsent:t(),type:"ot"}),n({hasConsent:t()})}))),0):An()||(fe({hasConsent:!1,type:"ot"}),n({hasConsent:!1}),0)))}const Ne=["g111","g11-","g1-1"];function De(n){var e,t;const o=decodeURIComponent(document.location.href.toLowerCase()),i=o.match(/[?&]gcs=([^&]*)/);if(null===(e=null==i||null===(t=i[1])||void 0===t?void 0:t.trim())||void 0===e||!e)return!1;const a=Ne.some((n=>o.includes("gcs=".concat(n))));return fe({hasConsent:a,type:"g111"}),n({hasConsent:a}),!0}function Le(n){if(!window.UC_UI)return!1;let e=!1;function t(){fe({hasConsent:o(),type:"uc"}),n({hasConsent:o()})}function o(){const n=window.UC_UI;return n.areAllConsentsAccepted()||!(null===(e=n.getServicesBaseInfo().find((n=>{var e;return(null===(e=n.name)||void 0===e?void 0:e.toLowerCase())===E})))||void 0===e||null===(e=e.consent)||void 0===e||!e.status);var e}return e||(e=!0,window.addEventListener("UC_UI_CMP_EVENT",(function(n){const{type:e}=n.detail;["ACCEPT_ALL","DENY_ALL","SAVE"].includes(e)&&t()}))),t(),!0}function Ue(n){function e(){var n;return!(null===(n=window.teads_e)||void 0===n||!n.some((n=>{const{shopifyEvent:e}=n;return"boolean"!=typeof e&&!!e&&function(n){let{analyticsProcessingAllowed:e,marketingAllowed:t,saleOfDataAllowed:o}=n;return e&&t&&o}(e)})))}return!!function(){const n=document.cookie,e=!!n&&["_shopify_ga","_shopify_y","_shopify_s","_shopify_fs","_shopify_sa_p","_shopify_sa_t","_shopify_country","_shopify_essential"].some((e=>n.includes(e))),t=document.location.href.toLowerCase().includes("/custom/web-pixel-");return e||t}()&&(null!==(t=window.teads_e)&&void 0!==t&&t.length&&window.teads_e.some((n=>{const{shopifyEvent:e}=n;return!!e&&"boolean"!=typeof e}))?(fe({hasConsent:e(),type:"shopify"}),n({hasConsent:e()}),!0):(fe({hasConsent:An(),type:"shopify"}),n({hasConsent:An()}),!0));var t}function Re(n,e,t){return new Promise((o=>{const i=n=>o({type:t,cmpFound:n});try{n((n=>{e({data:n}),i(!0)}),(n=>{e({error:n}),i(!0)}))||i(!1)}catch(n){e({error:n instanceof Error?n.message:String(n)}),i(!0)}}))}async function xe(){if(Sn())return s("GPC is blocking — skipping all CMP lookups and recording denied consent"),void fe({hasConsent:!1,type:"gpc"});await new Promise((n=>{const e=On()?()=>{}:P.once("consentGranted",n),t=[{type:"tcf",promise:Re(Ae,x,"tcf")},{type:"ccpa",promise:Re(Oe,z,"ccpa")},{type:"gpp",promise:Re(Ee,F,"gpp")},{type:"cb",promise:Re(Pe,H,"cb")},{type:"gtm",promise:Re(ke,J,"gtm")},{type:"di",promise:Re(Se,Z,"di")},{type:"ot",promise:Re(Te,$,"ot")},{type:"uc",promise:Re(Le,nn,"uc")},{type:"shopify",promise:Re(Ue,en,"shopify")},{type:"g111",promise:Re(De,Q,"g111")}],o=On()?t.filter((n=>we.includes(n.type))):t;Promise.all(o.map((n=>n.promise))).then((o=>{e();const i=o.filter((n=>_e(n.type)));s("CMP detection complete",{detected:o.filter((n=>n.cmpFound)).map((n=>n.type)),notDetected:o.filter((n=>!n.cmpFound)).map((n=>n.type)),supportedInZone:i.map((n=>n.type)),...On()&&{background:t.filter((n=>!we.includes(n.type))).map((n=>n.type))}}),On()&&be(V())&&fe({hasConsent:!1,type:"gpp_opt_out"}),On()&&Ce(V())&&fe({hasConsent:!1,type:"canada_opt_out"}),i.every((n=>!n.cmpFound))&&fe({hasConsent:An()||On(),type:"timeout"}),n()})),On()||!0!==dn()||(e(),n())}))}function Me(n){var e;return!1!==(null===(e=n.vendor)||void 0===e||null===(e=e.consents)||void 0===e?void 0:e[C])&&!0!==n.isServiceSpecific}const je="us";function Fe(n,e){return 0===n.indexOf(e+"=")}const Ge="PAGE_VIEW",Be="AUTO_NAVIGATE_ANOTHER_SITE",Ve="AUTO_TAB_LOST_FOCUS",ze="AUTO_10_SEC_ON_PAGE";function Xe(n){var e,t;return null===(e=(t=window).teads_setOutbrainCookieOnTeads)||void 0===e?void 0:e.call(t,"".concat(g,"=").concat(encodeURIComponent(JSON.stringify(n))))}function Je(){try{var n,e;const t=null===(n=(e=window).teads_getOutbrainCookieFromTeads)||void 0===n?void 0:n.call(e);return t?JSON.parse(decodeURIComponent(t.split("=")[1])):{}}catch(n){return Ln("Error while parsing Outbrain dicbo ID cookie",null==n?void 0:n.message),Un(n,"Error while parsing Outbrain dicbo ID cookie"),{}}}function We(){try{return Je()[g]}catch(n){return Ln("Error while parsing Outbrain click ID cookie",null==n?void 0:n.message),void Un(n,"Error while parsing Outbrain click ID cookie")}}function Ze(n){if("optout"!==n)if("NoClickId"===n)un()&&function(){const n=Je();n[m]=Date.now(),Xe(n)}();else{n&&(n=n.replace(/#/g,""));const e=Je();e[g]=n,Xe(e)}}function Ke(){const n=ln();return{cht:n.type,au:!n.hasConsent,referrer:document.URL,zone:window.teads_zone,bust:Math.random().toString().replace(".","")}}async function He(n,e,t){if(!un())return;const o={marketerId:e.join(","),name:n,dl:Dn(window),pRef:document.referrer,...t,...Ke()},i=We();i&&(o[h]=i),Object.keys(o).forEach((n=>(void 0===o[n]||""===o[n])&&delete o[n])),ae("".concat(p,"?").concat(function(n){const e=new URLSearchParams;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.append(t,String(n[t]));return e.toString()}(o)),!0,{referrerPolicy:"no-referrer-when-downgrade",eventSourceEligible:!1,triggerEligible:!0})}async function qe(n){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(un()&&(e||function(n){return!!n.conversionType&&["AddToCart","AddToWishlist","CompleteRegistration","InitiateCheckout","Lead","Purchase","ViewContent","Search"].includes(n.conversionType)}(n))){const{conversionType:e,name:t,shopifyEvent:o,price:i,...a}=n;i&&(a.orderValue="".concat(i)),"Purchase"===e&&(a.orderId=a.product_name||t);const r=wn(),s=[t,e].filter(Boolean);await Promise.all(s.map((n=>He(n,r,{price:i,...a}))))}}function $e(n,e,t){"track"===n&&e!==Ge&&qe({conversionType:e,...t},!0).catch((n=>{Ln("Error while sending Outbrain event",null==n?void 0:n.message),Un(n,"Error while sending Outbrain event",e,We())}))}let Ye=!1;const Qe={zone:O.Default},nt={conversionType:"conversion_type",price:"aepp",currency:"aepc",name:"aepn",product_name:"aeppn"};function et(n){var e,t,o;const i=In(),a=U();let r="referer=".concat(encodeURIComponent(n),"&tag_version=").concat(encodeURIComponent(c));void 0!==a?r+="&buyer_pixel_id=".concat(encodeURIComponent(a)):void 0!==i&&(r+="&advertiser_id=".concat(encodeURIComponent(i)));const s=M();var d,l;s&&(void 0!==(null==s||null===(d=s.data)||void 0===d?void 0:d.gdprApplies)&&(r+="&gdpr_applies=".concat(encodeURIComponent(s.data.gdprApplies))),null!=s&&null!==(l=s.data)&&void 0!==l&&l.tcString&&(r+="&gdpr_consent=".concat(encodeURIComponent(s.data.tcString))),null!=s&&s.error&&(r+="&gdpr_error=".concat(encodeURIComponent(s.error))));const u=X();null!=u&&null!==(e=u.data)&&void 0!==e&&e.usPrivacy&&(r+="&ccpa_consent=".concat(encodeURIComponent(u.data.usPrivacy))),null!=u&&u.error&&(r+="&ccpa_error=".concat(encodeURIComponent(u.error)));const p=G();null!=p&&null!==(t=p.data)&&void 0!==t&&t.applicableSections&&(r+="&gpp_applicable_sections=".concat(encodeURIComponent(p.data.applicableSections.join(",")))),null!=p&&null!==(o=p.data)&&void 0!==o&&o.gppString&&(r+="&gpp_consent=".concat(encodeURIComponent(p.data.gppString))),null!=p&&p.error&&(r+="&gpp_error=".concat(encodeURIComponent(p.error)));const v=function(){const n=Xn("optout");if(n)return"1"===n}();void 0!==v&&(r+="&web_opt_out=".concat(encodeURIComponent(v)));const f=V();var w;On()&&f&&(function(n){return Object.entries(n).some((n=>{let[e,t]=n;if(!e.startsWith(je)||"object"!=typeof t||null===t)return!1;const o=t;if("SaleOptOut"in o&&2!==o.SaleOptOut&&1!==o.SaleOptOut)return!0;if("TargetedAdvertisingOptOut"in o&&2!==o.TargetedAdvertisingOptOut&&1!==o.TargetedAdvertisingOptOut)return!0;if("SaleOptOutNotice"in o&&1!==o.SaleOptOutNotice)return!0;if("TargetedAdvertisingOptOutNotice"in o&&1!==o.TargetedAdvertisingOptOutNotice)return!0;const i=o.KnownChildSensitiveDataConsents;if(void 0!==i)if(Array.isArray(i)){if(i.some((n=>0!==n)))return!0}else if(0!==i)return!0;const a=o.SensitiveDataProcessing;if(Array.isArray(a)&&a.some((n=>2!==n)))return!0;if("usca"===e){if("SharingOptOut"in o&&2!==o.SharingOptOut&&1!==o.SharingOptOut)return!0;if("SharingOptOutNotice"in o&&1!==o.SharingOptOutNotice)return!0;if("SensitiveDataLimitUseNotice"in o&&1!==o.SensitiveDataLimitUseNotice)return!0;if("PersonalDataConsents"in o&&2!==o.PersonalDataConsents)return!0}return!1}))}(w=f)||Ce(w))&&(r+="&gpp_opt_out=1");const _=rn();_.hasConsent&&null!=s&&s.data&&Me(s.data)&&(r+="&tcf_strict_deny=1"),_.hasConsent&&f&&function(n){const e=n.tcfeuv2;return!(!e||"object"!=typeof e)&&Me(e)}(f)&&(r+="&gpp_strict_deny=1"),_.hasConsent&&f&&function(n){var e;const t=n.tcfeuv2;if(!t||"object"!=typeof t)return!1;const o=null===(e=t.purpose)||void 0===e?void 0:e.consents;return!(null==o||!o[1])&&A.some((n=>!o[n]))}(f)&&(r+="&gpp_tcf_purpose_deny=1");const g=W();g&&(g.data&&(r+=">m_consent=".concat(encodeURIComponent(g.data.hasConsent))),g.error&&(r+=">m_error=".concat(encodeURIComponent(g.error))));const h=K();h&&(h.data&&(r+="&didomi_consent=".concat(encodeURIComponent(h.data.hasConsent))),h.error&&(r+="&didomi_error=".concat(encodeURIComponent(h.error))));const m=q();m&&(m.data&&(r+="&cookiebot_consent=".concat(encodeURIComponent(m.data.hasConsent))),m.error&&(r+="&cookiebot_error=".concat(encodeURIComponent(m.error))));const y=Y();return y&&(y.data&&(r+="&onetrust_consent=".concat(encodeURIComponent(y.data.hasConsent))),y.error&&(r+="&onetrust_error=".concat(encodeURIComponent(y.error)))),void 0!==_.type&&(r+="&has_consent=".concat(encodeURIComponent(_.hasConsent)),r+="&cht=".concat(encodeURIComponent(_.type))),void 0!==window.teads_zone&&(r+="&zone=".concat(encodeURIComponent(window.teads_zone))),r}async function tt(n){if(on()){const e=function(n,e){const t={};return Object.keys(n).forEach((e=>{const o=e,i=n[e];Object.prototype.hasOwnProperty.call(nt,o)?t[nt[o]]=i+"":Ln("Invalid parameter specified in event: ".concat(o))})),t}(function(n){return n.name?n:{...n,name:n.conversionType}}(n)),t=d+Mn("conversion",e);ie(t),bn(t),qe(n).catch((e=>{Un(e,"Error while sending event based conversion",n.conversionType,We())}))}else un()&&qe(n).catch((e=>{Un(e,"Error while sending event based conversion",n.conversionType,We())}))}async function ot(){const n=[];for(;null!==(e=window.teads_e)&&void 0!==e&&e.length;){var e;n.push(tt(window.teads_e.shift()))}try{return await Promise.all(n)}catch(n){Ln("Error while sending event based conversion",null==n?void 0:n.message,Tn.INTERNAL)}}const it=n=>{const{auctionId:e,gdpr:t,ccpa:o,firstPartyCookieAllowed:i,domain:a,trackingAllowed:r,outbrainAdvertiserId:s,outbrainAdvertiserIds:c}=n;var d,l,u;d=i,window.first_party_cookie_allowed=d,kn()&&!r?tn([q(),K(),Y(),W(),window.teads_user_centric_consent_data,window.teads_shopify_consent_data,window.teads_in_iframe_consent_data].some((n=>{var e;return!0===(null==n||null===(e=n.data)||void 0===e?void 0:e.hasConsent)}))):tn(r),t&&(l=t,window.teads_gdpr_advertiser=l),o&&function(n){window.teads_ccpa_advertiser=n}(o),a&&(u=a,window.advertiser_domain=u),e&&(pn(e),fn("url")),s&&function(n){window.teads_outbrainAdvertiserId=n}(s);const p=null==c?void 0:c.map((n=>n.trim())).filter((n=>!!n));null!=p&&p.length&&function(n){window.teads_outbrainAdvertiserIds=n}(p)},at=n=>{if(n){const n=Hn(Bn.auctionId);if(n){const e=vn();e&&e!==n||fn("cookie"),e||pn(n)}return Wn(),n}return Vn(Bn.auctionId.key),null},rt=(n,e,t,o)=>{if(n){const n=Hn(Bn.sessionId);e&&t&&e!==t?gn(o):n?gn(n):o&&gn(o),Zn()}else o&&gn(o),Vn(Bn.sessionId.key)},st=(n,e)=>{if(e&&n){const n=Hn(Bn.viewerId);t=n||e,window.teads_viewer_id=t,function(){const n=mn();yn()&&n&&zn(Bn.viewerId.key,n,Bn.viewerId.maxAge)}()}else Vn(Bn.viewerId.key);var t};let ct=!1;function dt(n){var e,t;null===(e=async function(){if(!un())return;window.teads_setObCachedClickId=Ze;const n=function(n){let e=Dn(window);e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=(e.split("?")[1]||"").split(/&/);for(let e=0;e3e5}catch(n){return Ln("Error while parsing Outbrain click ID cookie",null==n?void 0:n.message),Un(n,"Error while parsing Outbrain click ID cookie"),!0}}()&&function(){const n=document.createElement("script"),e=_n();n.src="".concat(l,"/cachedClickId?marketerId=").concat(e,"&fromTeads=true"),document.body.appendChild(n)}()}())||void 0===e||e.catch(),null===(t=He(Ge,n,{pld:Math.floor(performance.now())}))||void 0===t||t.catch((n=>{Ln("Error while firing Outbrain Page View pixel",null==n?void 0:n.message),Un(n,"Error while firing Outbrain Page View pixel",Ge,We())})),function(n){un()&&null!=n&&n.length&&n.forEach((n=>{try{const e=document.createElement("script");e.src="".concat(u,"/mtWavesBundler/handler/").concat(n,"/true"),document.body.appendChild(e)}catch(n){Un(n,"Error while loading OB waves")}}))}(n),un()&&We()&&!Ye&&(Ye=!0,setTimeout((()=>{qe({conversionType:ze},!0)}),1e4),document.addEventListener("visibilitychange",(()=>{document.hidden&&qe({conversionType:Ve})})),window.addEventListener("beforeunload",(()=>{qe({conversionType:Be})})))}const lt=async()=>{const n=d+Mn("pageView",{});s("Sending page view pixel via DOM img tag"),ie(n),bn(n),await ae(d+Mn("browser-topics",{}),!1)},ut=()=>{const n=Mn("timeSpent",{}),e=d+n;Cn(!1),document.addEventListener("visibilitychange",(n=>()=>{"hidden"===document.visibilityState&&!0!==D&&(Cn(!0),re(n,!0),Zn(),bn(n))})(e))},pt=()=>{const n=window.teads_e||[];window.teads_e=[],window.teads_e.push=function(){for(var n=arguments.length,e=new Array(n),t=0;t{await xe(),on()&&(clearInterval(e),await ot()),n--,0===n&&clearInterval(e)}),ft)}(),Zn()):Ln("The event queue is not defined.")}(),window.teads_e.length},window.teads_e.push(...n)};async function vt(){const n=In(),e=U();r&&s("Firing pixel",{buyerPixelId:e,advertiserId:n,idUsed:void 0!==e?"buyerPixelId":void 0!==n?"advertiserId":"none — pixel will not fire"}),"number"==typeof n||"number"==typeof e?(await async function(){try{const e=await async function(){const n=Dn(window),e=et(n);try{const n=await fetch("".concat(v,"?").concat(e),{cache:"no-cache"});if(200===(null==n?void 0:n.status)){var t,o,i,a,r,s,c,d,l,u;const e=await n.json(),p=null==e||null===(t=e.outbrain_advertiser_ids)||void 0===t||null===(o=t.map)||void 0===o?void 0:o.call(t,(n=>n.trim())).filter((n=>n.length>0));return{trackingAllowed:!1!==(null==e?void 0:e.tracking_allowed),firstPartyCookieAllowed:!0===(null==e?void 0:e.first_party_cookie_allowed),sessionId:null==e?void 0:e.session_id,auctionId:null==e?void 0:e.auction_id,viewerId:null==e?void 0:e.user_id,domain:null==e?void 0:e.domain,ccpa:null!=e&&e.ccpa?{apply:null===(i=e.ccpa)||void 0===i?void 0:i.apply,teadsConsent:null===(a=e.ccpa)||void 0===a?void 0:a.teads_consent}:void 0,gpp:null!=e&&e.gpp?{apply:null===(r=e.gpp)||void 0===r?void 0:r.apply,teadsConsent:null===(s=e.gpp)||void 0===s?void 0:s.teads_consent}:void 0,gdpr:null!=e&&e.gdpr?{apply:null===(c=e.gdpr)||void 0===c?void 0:c.apply,teadsConsent:null===(d=e.gdpr)||void 0===d?void 0:d.teads_consent,apiVersion:null===(l=e.gdpr)||void 0===l?void 0:l.api_version,cmpId:null===(u=e.gdpr)||void 0===u?void 0:u.cmp_id,isServiceSpecific:null==e?void 0:e.gdpr.is_service_specific}:void 0,outbrainAdvertiserId:null==e?void 0:e.outbrain_advertiser_id,outbrainAdvertiserIds:null!=p&&p.length?p:void 0}}}catch(n){Ln("Error while trigger API to know advertiser information",null==n?void 0:n.message,Tn.INTERNAL)}const p=xn(n);return p?{trackingAllowed:!0,firstPartyCookieAllowed:!1,auctionId:p}:{trackingAllowed:!0,firstPartyCookieAllowed:!1}}(),{sessionId:t,auctionId:o,viewerId:i}=e;var n;it(e),r&&s("Advertiser API response",{trackingAllowed:e.trackingAllowed,firstPartyCookieAllowed:e.firstPartyCookieAllowed,gdpr:e.gdpr,ccpa:e.ccpa,auctionId:e.auctionId,outbrainAdvertiserIds:null!==(n=e.outbrainAdvertiserIds)&&void 0!==n?n:e.outbrainAdvertiserId?[e.outbrainAdvertiserId]:[]});const a=wn();a.length&&(window.teads_obEvent=$e,dt(a),ct||un()||(ct=!0,P.on("hasObConsent",(()=>{dt(a)}))));const c=yn(),d=at(c);rt(c,d,o,t),st(c,i),R()&&Qn(qn.CONSENT_INFO_LOADED,{trackingAllowed:on(),firstPartyCookieAllowed:yn(),advertiserDomain:L(),auctionId:vn(),iabData:M(),uspData:X(),isCompatibleCMPDetected:cn(),consentHandlerType:sn(),hasConsent:rn().hasConsent})}catch(n){Ln("Error while initializing advertiser",null==n?void 0:n.message,Tn.INTERNAL)}}(),await async function(){on()?(s("Tracking allowed — sending page view"),await lt(),await ut(),pt()):s("Tracking blocked — server denied tracking for this visitor")}()):s("Pixel will not fire — no advertiser or pixel id or they are not numbers")}const ft=500,wt=5e3;function _t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft;s("Waiting for consent, retrying in ".concat(n,"ms")),xe().then((()=>{if(!0===dn())s("Consent received during polling, firing pixel"),vt().catch((n=>Ln("Error while firing pixel",null==n?void 0:n.message)));else{const e=Math.min(2*n,wt);setTimeout((()=>_t(e)),n)}})).catch((e=>{Ln("Error while checking consent",null==e?void 0:e.message);const t=Math.min(2*n,wt);setTimeout((()=>_t(t)),n)}))}async function gt(){if(r){const n=rn();s("Initialize",{zone:window.teads_zone,advertiserId:In(),buyerPixelId:U(),consent:{hasConsent:n.hasConsent,cmp:n.type},isDefaultZone:An(),isUsCanadaZone:On(),decision:Sn()?"blocked by GPC":On()?"checking opt-out signals":An()||!0===dn()?"firing pixel":"waiting for consent"})}if(Sn())s("Pixel blocked — GPC is set and zone requires it to be honoured");else if(An())await vt();else if(On()){await xe();const n=V();be(n)?s("Pixel blocked — US GPP opt-out signal detected"):Ce(n)?s("Pixel blocked — Canada GPP opt-out signal detected"):await vt()}else!0===dn()?await vt():_t()}async function ht(){try{window.teads_adv_id||Object.defineProperty(window,"teads_adv_id",{set(n){this._teads_adv_id=n,gt()},get(){return this._teads_adv_id},configurable:!0}),window.teads_buyer_pixel_id||Object.defineProperty(window,"teads_buyer_pixel_id",{set(n){this._teads_buyer_pixel_id=n,gt()},get(){return this._teads_buyer_pixel_id},configurable:!0})}catch(n){Ln("Error while binding advertiser and pixel ids",null==n?void 0:n.message)}try{window.teads_setOutbrainCookieOnTeads||(window.teads_setOutbrainCookieOnTeads=function(n){const e=Jn(),t=JSON.parse(e);t[w]=n,zn(Bn.auctionId.key,btoa(JSON.stringify(t)),Bn.auctionId.maxAge)}),window.teads_getOutbrainCookieFromTeads||(window.teads_getOutbrainCookieFromTeads=function(){const n=Jn();return JSON.parse(n)[w]})}catch(n){Ln("Error while loading Outbrain",null==n?void 0:n.message)}await gt()}return async function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{"undefined"!=typeof window&&(r&&s('Debug mode enabled. To disable: localStorage.removeItem("teads_debug")'),window.teads_zone=Qe.zone,s("Tag starting",{zone:Qe.zone,waitMs:n}),Nn(null===(e=window)||void 0===e?void 0:e.addEventListener)&&(Yn(qn.PIXEL_LOADED),Qn(qn.PIXEL_LOADED),window.addEventListener("message",ne)),await new Promise(((e,t)=>{setTimeout((()=>{xe().then((()=>ht())).then(e).catch(t)}),n>=0?n:0)})))}catch(n){Ln("Unhandled exception",null==n?void 0:n.message,Tn.INTERNAL),un()&&_n()&&Un(n,"Unhandled exception")}var e}(0),a})()));